#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+7;
int a[maxn];
int n;
int ans;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    sort(a+1,a+1+n);
    int st=1;
    for(int i=2;i<=n;i++)
    {
        if(a[i]==a[st])
            continue;
        st++;
    }
    printf("%d",n-st+1);

    fclose(stdin);
    fclose(stdout);
    return 0;
}
